<?php

use Illuminate\Database\Seeder;

class AgentRewardRuleSettingsSeeder extends Seeder
{
    /**
     * 初始化权限数据
     */
    public function run()
    {
        $now = \Carbon\Carbon::now()->format('Y-m-d H:i:s');
        \Illuminate\Support\Facades\DB::table('agent_reward_rule_settings')->insert([
            // 充值奖励
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_RECHARGE_BONUS,
                'threshold_amount' => 100 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 5 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_RECHARGE_BONUS,
                'threshold_amount' => 200 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 12 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_RECHARGE_BONUS,
                'threshold_amount' => 300 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 18 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_RECHARGE_BONUS,
                'threshold_amount' => 400 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 24 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],

            // 每日下单奖励
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_DAILY_ORDER_REWARD,
                'threshold_amount' => 100 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 5 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_DAILY_ORDER_REWARD,
                'threshold_amount' => 200 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 12 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_DAILY_ORDER_REWARD,
                'threshold_amount' => 300 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 18 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_DAILY_ORDER_REWARD,
                'threshold_amount' => 400 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 24 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],

            // 每月下单奖励
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_MONTHLY_ORDER_REWARD,
                'threshold_amount' => 100 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 5 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_MONTHLY_ORDER_REWARD,
                'threshold_amount' => 200 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 12 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_MONTHLY_ORDER_REWARD,
                'threshold_amount' => 300 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 18 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'type' => \App\Models\AgentRewardRuleSettings::TYPE_MONTHLY_ORDER_REWARD,
                'threshold_amount' => 400 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'reward' => 24 * \App\Models\Base::CURRENCY_UNIT_CONVERSION,
                'operator_id' => 1,
                'created_at' => $now,
                'updated_at' => $now
            ],
        ]);
    }
}
